let box = document.querySelectorAll('input[value=a]');
let all = document.querySelector('.all');
let no = document.querySelector('.no');
let reverse = document.querySelector('.reverse');
let print = document.querySelector('.print');
all.onclick = function () {
    box.forEach(function (v) {
        if (v.checked == false) {
            v.checked = true;
        }
    });
};
no.onclick = function () {
    box.forEach(function (v) {
        if (v.checked == true) {
            v.checked = false;
        }
    });
};
reverse.onclick = function () {
    box.forEach(function (v) {
        v.checked = !v.checked;
    });
};
print.onclick = function () {
    box.forEach(function (v) {
        if (v.checked == true) {
            console.log(v.nextSibling);
        }
    });
};
let add = document.querySelector('.add');
let insert = document.querySelector('.insert');
let replace = document.querySelector('.replace');
let remove = document.querySelector('.remove');
let read = document.querySelector('.read');
let child = document.querySelector('.child');
let ul = document.querySelector('ul'),
    li;
let bj = document.querySelector('.bj');
add.onclick = function () {
    li = document.createElement('li');
    li.append('广州');
};
insert.onclick = function () {
    ul.insertBefore(li, ul.firstChild);
};
replace.onclick = function () {
    ul.replaceChild(li, bj);
};
remove.onclick = function () {
    ul.removeChild(li);
};
read.onclick = function () {
    console.log(ul);
};
child.onclick = function () {
    console.log(ul.children[0].childNodes);
};
